package com.smart.admin.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.smart.admin.entity.CartItem;
import com.smart.admin.mapper.CartItemMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * .............................................
 * When I wrote this, only God and I understood what I was doing
 * Now, God only knows
 * .............................................
 *
 * @ProjectName: spring-boot-demo
 * @Package: com.smart.admin.controller
 * @ClassName: CartItemController
 * @Description: 描述
 * @Author: zhangwei
 * @CreateDate: 2021/12/14 15:38
 * @UpdateUser: 更新者
 * @UpdateDate: 2021/12/14 15:38
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
@RestController
@RequestMapping("/cart")
public class CartItemController {
    @Resource
    CartItemMapper cartItemMapper;

    @GetMapping("/list")
    public IPage<CartItem> list(int page, int size) {
        Page<CartItem> cartItemPage = cartItemMapper.selectPage(new Page<>(page, size), null);
        return cartItemPage;
    }

}
